//
//  FuncHelper.swift
//  DMRCommonBaseLib
//
//  Created by edy on 2025/11/4.
//

import Foundation

/// 同步执行
public func simpleSynchronized(lock: AnyObject, closure: () -> Void) {
    objc_sync_enter(lock)
    closure()
    objc_sync_exit(lock)
}

public extension Equatable {
    
    func isEqualIn<T: Equatable>(_ list: [T]) -> Bool {
        guard let st = self as? T else {
            return false
        }
        
        for i in list {
            if i == st {
                return true
            }
        }
        
        return false
    }
    
}
